<template>
    <div>
        订单页
        <hr>
        默认地址
        <hr>
        购买商品展示
    </div>
</template>

<script setup>

import { ref, computed, watchEffect,onMounted } from "vue";
import { storeToRefs } from "pinia";
import { useRouter, useRoute } from 'vue-router';
import { showFailToast, showSuccessToast, showToast } from 'vant';

import { confirmOrderAPI } from "@/api/order.js";
import { useUserStore } from "@/stores/user.js"

let router = useRouter();
let route = useRoute();
let User = useUserStore();
let { isLogin, userid } = storeToRefs(User);

let list = ref([]);

let confirmOrder = async () => {
    try {
        var res = await confirmOrderAPI({
            userid: userid.value,
            time:route.query.time
        });
        console.log("订单查询成功", res);
        list.value = res.data;
    } catch (err) {
        showFailToast(err.message);
    }
}


onMounted(()=>{
    confirmOrder();
})


</script>

<style lang="scss" scoped></style>